Don't leak node->mime_type if we are reusing an existing node. (#170774,
authorMatthias Clasen <mclasen@redhat.com>
Sun, 20 Mar 2005 07:10:14 +0000 (07:10 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 20 Mar 2005 07:10:14 +0000 (07:10 +0000)
2005-03-20  Matthias Clasen  <mclasen@redhat.com>

* xdgmimeglob.c (_xdg_glob_hash_insert_text): Don't
leak node->mime_type if we are reusing an existing
node.  (#170774, Kjartan Maraas)

gtk/xdgmime/ChangeLog
gtk/xdgmime/xdgmimeglob.c

index 1daeb8076a8668cf0bb467aac19f07abb89ff3d7..3bd89fed9a0eabef9195968c1b1a558846ade4b8 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-20  Matthias Clasen  <mclasen@redhat.com>
+
+       * xdgmimeglob.c (_xdg_glob_hash_insert_text): Don't 
+       leak node->mime_type if we are reusing an existing
+       node.  (#170774, Kjartan Maraas)
+
 2005-01-08  Matthias Clasen  <mclasen@redhat.com>
 
        * === Released 2.6.1 ===
index e4a849c21893588b501b6d4e9f4b6e3fd10af6b7..fb89e82023c0fb8c5a6fb9016070104e8c3cf2d3 100644 (file)
@@ -241,6 +241,8 @@ _xdg_glob_hash_insert_text (XdgGlobHashNode *glob_hash_node,
   text = _xdg_utf8_next_char (text);
   if (*text == '\000')
     {
+      if (node->mime_type)
+       free (node->mime_type);
       node->mime_type = mime_type;
     }
   else